package com.ossean.projectmanager.lasttabledao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface TagDao {
	
	//根据标签名 取出标签id
	@Select("select id from tags where name=#{name}")
	public List<Integer> getIdByName(@Param("name") String name);
	
	
	//向tags表插入数据
	@Insert("insert into tags (name) values (#{name})")
	public void insertTag(@Param("name") String name);
	
	//根据标签id获得标签名
	@Select("SELECT name FROM tags WHERE id = #{tagId}")
	public String getNameById(@Param("tagId") int tagId);
	
}
